package com.lb.trac.pojo.condition.order;

import org.apache.commons.lang.StringUtils;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Property;

import com.lb.trac.pojo.Utenti;
import com.lb.trac.pojo.comparator.OrderBy;

public class FindUtentiOrderByNome implements OrderCondition {

	
	private int type;


	@Override
	public Object create(Object... criterias) {
		Criteria criteria = (Criteria) criterias[0];
		if(type==OrderBy.ASC){
			criteria.addOrder(Order.asc("nome"));
		}else{
			criteria.addOrder(Order.desc("nome"));
		}
		
		return criteria;
	}


	public int getType() {
		return type;
	}


	public void setType(int type) {
		this.type = type;
	}
	


}
